import matplotlib.pyplot as plt

# x_values = [1, 2, 3, 4, 5]
# y_values = [1, 4, 9, 16, 25]
x_values = range(1, 1001)
y_values = [x**2 for x in x_values]

plt.style.use('seaborn-v0_8')

fig, ax = plt.subplots()
# ax.scatter(2, 4, s=200)
# ax.scatter(x_values, y_values, color='red', s=10)
# ax.scatter(x_values, y_values, color=(0, 0.8, 0), s=10)
ax.scatter(x_values, y_values, c=y_values, cmap="Blues", s=10)

# 设置图题并给坐标轴加上标签
ax.set_title("Square Numbers", fontsize=24)
ax.set_xlabel("Value", fontsize=14)
ax.set_ylabel("Square of Value", fontsize=14)
# 设置刻度标记的样式
ax.tick_params(labelsize=14)

# 设置每个坐标轴的取值范围
ax.axis([0, 1100, 0, 1_100_000]) # [xmin, xmax, ymin, ymax]
ax.ticklabel_format(style='plain') # 禁用科学计数法显示刻度标签

plt.show()
# plt.savefig('squares_plot.png', bbox_inches='tight') # save 和 show 互斥